<h2>Vizualizare progres: <?= $tema['Theme']['name'] ?></h2>
 <a href="<?=SITE_URL?>profesor/adaugare_etapa/<?=$tema['Theme']['id']?>" class="link_util">Adaugare Etapa</a>
<div id="accordion">
    <?php foreach( $tema['Stage'] as $s ) { ?>
        <h3>
            <?php echo $s['name']; ?>

            <?=
                $this->Form->checkbox( "done", array(
                    "class"       => "stage_check mark-check" . ( ( $s['done'] ) ? " check_profesor" : "" ),
                    "hiddenField" => false,
                    "data-ref"    => "1-1-" . $s['id'],
                    "checked"     => $s['done'] == 1 ? true : false,
                    "value"       => $s['done']
                ) ); ?>
            <i class="fa <?= ( $s['done'] ? "fa-check-square-o" : "fa-square-o" ) ?>"></i>
        </h3>
        <div>
            
            <a class="link_edit_etapa" href="<?= SITE_URL ?>profesor/editare_etapa/<?= $s['id'] ?>"><i class="fa fa-edit"></i> </a>
            <a class="link_edit_etapa" href="<?= SITE_URL ?>profesor/stergere_etapa/<?= $s['id'] ?>"><i class="fa fa-times-circle"></i> </a>
            <div class="stage_date"> Data limita: <?php echo $s['limit_date']; ?> </div>
            <div class="stage_desc"> <?php echo $s['description']; ?> </div>

            <? if( count( $s['Task'] ) > 0 ) { ?>

                <? foreach( $s['Task'] as $task ) {
                    echo '<div class="stage_task">';
                    echo "<div>" . $task['name'] . "</div>";

                        if ($task['check_profesor'])
                            $class = "fa-check-circle-o check_profesor";
                            else
                            if ($task['check_student'])
                            $class = " fa-check-circle-o";
                            else
                            $class = " fa-circle-o";
                    echo $this->Form->checkbox( "Task.check_profesor", array(
                        "class"       => "mark-check" ,
                        "hiddenField" => false,
                        "data-ref"    => "1-0-" . $task['id'],
                        "checked"     => $task['check_profesor'] == 1 ? true : false,
                        "value"       => $task['check_profesor']
                    ) );
                    echo '<i class="fa ' . $class . '"></i>';
                    echo '</div>';
                } ?>
            <? } ?>
        </div>
    <?php } ?>
    <h3>Documentatie</h3>
        <div>
            <?php
                foreach ($tema['Extra'] as $extra)
                {
                    echo '<a class="extra_link" href="'.SITE_URL.$extra['path'].'">'.$extra['name'].'</a>';
                }
            ?>
        </div>

</div>